package GoodsActivityService

import (
	"gdshop-back-end-go/common/entity"
	"github.com/gogf/gf/encoding/gjson"
)

// 解析路由规则
func AnalysisRule(ruleStr string) ([]*entity.RulesItem, error) {
	json, err := gjson.LoadContent(ruleStr)
	if err != nil {
		return nil, err
	}
	var tmps []*entity.RulesItem
	err = json.Structs(&tmps)
	if err != nil {
		return nil, err
	}
	return tmps, nil
}
